package sqlib;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class DBSimulator {

	public static List<String[]> getAllRecords(String tableName) {
		List<String[]> list = new ArrayList<String[]>();
		try {
			Scanner scanner = new Scanner(new File(tableName + ".db"));
			while(scanner.hasNextLine()) {
				String line = scanner.nextLine();
				list.add(line.split(","));
			}
			scanner.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		
		return list;
	}
	
	public static void main(String[] args) {
		List<String[]> list = getAllRecords("Employee");
		for(String[] record : list)
			System.out.println(Arrays.toString(record));
	}
}
